package com.atguigu.tingshu.account.api;

import com.atguigu.tingshu.account.service.RechargeInfoService;
import com.atguigu.tingshu.common.login.GuiguLogin;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.account.RechargeInfo;
import com.atguigu.tingshu.model.account.Tocharge;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Tag(name = "充值管理")
@RestController
@RequestMapping("api/account/rechargeInfo")
@SuppressWarnings({"unchecked", "rawtypes"})
public class RechargeInfoApiController {

	@Autowired
	private RechargeInfoService rechargeInfoService;
	// 账户充值
	// http://127.0.0.1:8500/api/account/rechargeInfo/submitRecharge
	@GuiguLogin
	@Operation(summary = "账户充值")
	@PostMapping("submitRecharge")
	public Result submitRecharge(@RequestBody Tocharge tocharge) {
		// amount: 30
		// payWay: "1101"
		rechargeInfoService.submitRecharge(tocharge);
		return Result.ok();
	}

}

